Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
12 lines (10 loc) · 344 Bytes

2.2.8 - Server::$ports.md

File metadata and controls

12 lines (10 loc) · 344 Bytes

Server::$ports

监听端口数组,如果服务器监听了多个端口可以遍历Server::$ports得到所有Swoole\Server\Port对象。 其中swoole_server::$ports[0]为构造方法所设置的主服务器端口。

$ports = $server->ports;
$ports[0]->set($settings);
$ports[1]->on("Receive", function () {
	//callback
});